<script setup>
    import { ref } from 'vue'

    const msg = ref("Hello Vue")
    const fcolor = ref("")

    function addColor(){
        fcolor.value = "color:red;"
    }
</script>

<template>
    <p :style="fcolor"> 
        {{ msg }} 
    </p>
    <p>
        <button @click="addColor">添加字体颜色</button>
    </p>
</template>

<style>
    p{
        font-size: 30px;
    }
    button{
        font-size: 20px;
    }
</style>
